<%@page import="java.util.ArrayList"%>
<%@page import="com.wanmait.cookbook.vo.Pager"%>
<%@page import="com.wanmait.cookbook.vo.Userinfo"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<!-- saved from url=(0031)https://www.douguo.com/user/pro -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


<title>豆果美食达人认证_领先的中文美食菜谱分享,交流社区-豆果美食</title>
<link rel="icon"
	href="https://cp1.douguo.com/static/nweb/images/favicon.ico?v=1912"
	type="image/x-icon">
<link rel="stylesheet"
	href="<%=path%>/static/hotUserinfoShowList_files/main.css">
<link rel="stylesheet"
	href="<%=path%>/static/hotUserinfoShowList_files/gourmet.css">
<script src="<%=path%>/static/hotUserinfoShowList_files/hm.js.下载"></script>
<script src="<%=path%>/static/hotUserinfoShowList_files/jquery.js.下载"></script>
<script data-ad-client="ca-pub-6608973961595981" async=""
	src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?f4fa5d56f272ae0a0777feec2184a97f";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
<style>
.one-pan-tip {
	cursor: pointer;
}

.one-pan-tip::before {
	background-position: center;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	box-sizing: border-box;
	width: 1em;
	height: 1em;
	margin: 0 1px .15em 1px;
	vertical-align: middle;
	display: inline-block;
}

.one-pan-tip-success::before {
	content: '';
	background-image:
		url()
}

.one-pan-tip-error {
	text-decoration: line-through;
}

.one-pan-tip-error::before {
	content: '';
	background-image:
		url()
}

.one-pan-tip-other::before {
	content: '';
	background-image:
		url()
}

.one-pan-tip-lock::before {
	content: '';
	background-image:
		url()
}
</style>
<meta name="ljjc::status" content="on">
</head>
<body>
	<jsp:include page="/inc/head.jsp"></jsp:include>
	<script>
    //var time=Date.parse(new Date());
    $.ajax({
        url: "/login/user?time="+new Date().getTime(),
        data:"",
        success:function(res) {
            var headhtml="";
            if(res.data.user.user_id){//登录
                var user=res.data.user;
                // 发布弹窗
                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a>';
                if(user.is_create_article){
                    headhtml+='<a href="/uparticle.html">发布长笔记</a>';
                }
                if(user.is_create_video){
                    headhtml+='<a href="/video/upvideo">发布视频</a>';
                }
                headhtml+="  </div> </div>";
                //头像
                headhtml+='<div class="myinfo relative" onmouseover="javascript:$(\'.myedit\').show();" onmouseout="javascript:$(\'.myedit\').hide();"> <a class="headicon" href="/u/'+user.username+'.html"> <img class="wb100 br50" src="'+user.headicon+'" alt=""> <span class="msgnum"></span> </a> <div class="myedit br8"> <span class="arwwj"> </span> <a class="relative" href="/message/remind/1" target="_blank">消息提醒 <span class="boll"></span> </a> <a href="/u/'+user.username+'/collect">我的收藏</a> <a href="/draft/recipe">草稿箱</a> <a href="/user/profile" target="_blank">账号设置</a> <a href="/logout?v=1540878216">退出</a> </div> </div>';
            }else{//未登录
                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a> </div> </div> <div class="perinfo"> <a class="login" href="/login"> 登录 </a> | <a class="register" href="/signup.html" target="_blank"> 注册 </a></div>';
            }
            $("#header .header").append(headhtml);
        }
    });
</script>
	<div id="content">
		<div class="clearfix mt30">
			<div id="left">
				<div class="condition">
					<div class="des-title">
						<h3>我的关注</h3>
					</div>
					<!-- <p>如果您烧得一手好菜，或是烘焙高手，经常发菜谱与网友分享自己的美食制作心得，您可以申请为南瓜美食达人。</p>
					<h4>达人的优秀品质：</h4>
					<p>1、您必须有头像、个人介绍，且经验在5000分以上。您可以通过发菜谱、发美食图片、评论、点赞、分享等等来获得积分。</p>
					<p>2、您发布的菜谱必须是原创，且数量在25道以上，图片美观、内容精良。</p>
					<p>3、 长期不活跃的认证达人，我们很遗憾但只能取消您的达人资格。</p>-->
				</div>
			</div>
		
		</div>
		<div class="gourmet-list" id="hotUserinfoShow"  >
			
			<ul class="clearfix"  >
			<!-- 显示产品开始 -->
				<%			
				Userinfo userinfo = (Userinfo)request.getSession().getAttribute("userinfo");
			List<Userinfo> userinfos = (List<Userinfo>)request.getAttribute("userinfos");
			for(int i=0;i<userinfos.size();i++){
				if((i+1)%3!=0){
					%>
				<li class="clearfix user ">
				<input type="hidden" value="<%=userinfos.get(i).getId() %>" class="gzz">
					<div class="left">
						<a href="<%=path %>/PersonalServlet?action=init&id=<%=userinfos.get(i).getId() %>"
							target="_blank" class="user-img" one-link-mark="yes"> <img
							src="<%=path%>/static/image/<%=userinfos.get(i).getAvatar() %>">
						</a> 
						<a href="javascript:void(0)"
							class="fav-btn"
							data-id="<%=userinfos.get(i).getId()%>" one-link-mark="yes"> 
							<span class="addicon" id="gz<%=userinfos.get(i).getId()%>">＋</span> 关注

						</a>
					</div>
					<div class="right">
						<h3>
							<a class="nickname text-lips"
								href="<%=path %>/PersonalServlet?action=init&id=<%=userinfos.get(i).getId() %>"
								one-link-mark="yes"><%=userinfos.get(i).getName() %></a>
						</h3>
						
						<p>
							简介<%=userinfos.get(i).getInfo() %></p>
					</div>
				</li>
				<%	
					
				}else{
				
			%>

				<li class="clearfix user  three ">
				<input type="hidden" value="<%=userinfos.get(i).getId() %>" class="gzz">
					<div class="left">
						<a href="<%=path %>/PersonalServlet?action=init&id=<%=userinfos.get(i).getId() %>"
							target="_blank" class="user-img" one-link-mark="yes"> <img
							src="<%=path%>/static/image/<%=userinfos.get(i).getAvatar() %>">
						</a> 
						<a href="javascript:void(0)"
							class="fav-btn" 
							data-id="<%=userinfos.get(i).getId()%>" one-link-mark="yes"> 
							<span class="addicon" id="gz<%=userinfos.get(i).getId()%>">＋</span> 关注
							
						</a>
					</div>
	<%-- 				<div class="right">
						<h3>
							<a class="nickname text-lips"
								href="<%=path %>/PersonalServlet?action=init&id=<%=userinfos.get(i).getId() %>"
								one-link-mark="yes"><%=userinfos.get(i).getName() %></a> <a
								class="proicon" href="<%=path %>/PersonalServlet?action=init&id=<%=userinfos.get(i).getId() %>"
								target="_blank" one-link-mark="yes"> <img class="proimg"
								src="<%=path%>/static/hotUserinfoShowList_files/2ba3cf1657cbf92e474d7e0534ce8da1.png"
								alt="">
							</a>
						</h3>
						<p class="cate">公司机构</p>
						<p>
							简介<%=userinfos.get(i).getInfo() %></p>
					</div> --%>
				</li>

				<%} }%>
					</ul>
						<!--显示数字开始  -->
			<div class="pages" id="numbParent">
			
			<%
				Pager pager=(Pager)request.getAttribute("pager");
				int start=1;
				int end=pager.getPageCount();
				if(pager.getPageCount()>5){
					start=pager.getPageNo()-2<1?1:pager.getPageNo()-2;
					end=start+4;
					if(end>pager.getPageCount()){
						end=pager.getPageCount();
						start=end-4;
					}
				}
				%>
				<a id="numb"  href="javascript:void(0);" class="prevPager" one-link-mark="yes">上一页</a>
				<%
				for(int i=start;i<=end;i++){
					if(i==pager.getPageNo()){
						%><a id="numb"  href="javascript:void(0);" style="color:red" class="aliaon" one-link-mark="yes"><%=i %></a>
					<% }else{
						%>
						<a id="numb"  href="javascript:void(0);" class="aliaon" one-link-mark="yes"><%=i %></a>
						<% 
					}
				}
			%>	
			<a id="numb"  href="javascript:void(0);" class="nextPager" one-link-mark="yes">下一页</a>
			<a id="numb"  href="javascript:void(0);" class="aliaon" one-link-mark="yes"><%=pager.getPageNo()%>/<%=pager.getPageCount()%></a>
			
<!-- 上下页事件开始 -->
<script type="text/javascript">
$(function(){
	//上一页点击事件
	$(".prevPager").click(function(){
		var n=<%=pager.getPageNo()%>;
		$.ajax({
			url:"<%=path%>/UserInfoServlet",
			data:{action:"showPagerAttentiuonUser",pageNo:n-1},
			success:function(mes){
				$("#hotUserinfoShow").html(mes);
			}
			
		});
	});
	//下一页点击事件
	$(".nextPager").click(function(){
		var n=<%=pager.getPageNo()%>;
		$.ajax({
			url:"<%=path%>/UserInfoServlet",
			data:{action:"showPagerAttentiuonUser",pageNo:n+1},
			success:function(mes){
				$("#hotUserinfoShow").html(mes);
			}
			
		});
	});

})
</script>	
<!--上下页事件结束  -->			
					
			</div>		
			
			<!--显示数字结束  -->
				
				
		
			<!-- 显示产品结束 -->
	
		</div>
		<p class="fcc">
			你当前的位置：<a href="<%=path %>" target="_blank"
				one-link-mark="yes">豆果美食</a> &gt; 美食达人
		</p>
	</div>
	<jsp:include page="/inc/foot.jsp"></jsp:include>
	<script src="<%=path%>/static/hotUserinfoShowList_files/tip.js.下载"></script>
	<script src="<%=path%>/static/hotUserinfoShowList_files/search.js.下载"></script>
	<script src="<%=path%>/static/hotUserinfoShowList_files/main.js.下载"></script>
	<!-- <script src='https://s13.cnzz.com/c.php?id=30029854' language='JavaScript' charset='gb2312'></script> -->

</body>
</html>
<!--给数字按钮加事件  -->
<script type="text/javascript">
$(function(){
	$("#hotUserinfoShow").on("click",".aliaon",function(){
		
		$(".aliaon").css("color","black");
		$(this).css("color","orange");
		var n=$(this).html();
		//ajax
		$.ajax({
			url:"<%=path%>/UserInfoServlet",
			data:{action:"showPagerAttentiuonUser",pageNo:n},
			success:function(mes){
				$("#hotUserinfoShow").html(mes);
			}
		});
	});
	
	if(<%=userinfo!=null%>){
		$(".gzz").each(function(){
			var aid = $(this).val();
			$.ajax({
				url:"<%=path%>/AttentionServlet",
				data:{action:"judgeAttention",authorId:aid},
				success:function(msg){
					if(msg=="true"){
        				$("#gz"+aid+"").text("已");
        			}
        			else{
        				$("#gz"+aid+"").text("＋");
        			}
				}
			});
		});
		$(".fav-btn").click(function(){
			var aid =$(this).data("id");
			if($("#gz"+aid+"").text()=="＋"){
    			$.ajax({
    				url:"<%=path%>/AttentionServlet",
    				data:{action:"addAttention",authorId:aid}
    			});
    			$("#gz"+aid+"").text("已");
    		}
    		else{
    			if(!window.confirm("确定取消关注？")){
    				return;
    			}
    			$.ajax({
    				url:"<%=path%>/AttentionServlet",
    				data:{action:"cancelAttention",authorId:aid}
    			});
    			$("#gz"+aid+"").text("＋");
    		}
			 
		});
	}
	else{
		$(".fav-btn").click(function(){
			var aid =$(this).data("id");
    		$.ajax({
    			url:"<%=path%>/AttentionServlet",
    			data:{action:"addAttention",authorId:aid},
    			success:function(msg){
    				if("no"==msg){
    					window.location.href="<%=path%>/login.jsp";
    				}
    			}
    		}); 
    	});
	}
	 
});

</script>